{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Python OOPS- Inheritance"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "### All the class variables are public\n",
    "### Car Blueprint\n",
    "class Car():\n",
    "    def __init__(self,windows,doors,enginetype):\n",
    "        self.windows=windows\n",
    "        self.doors=doors\n",
    "        self.enginetype=enginetype\n",
    "    def drive(self):\n",
    "        print(\"The Person drives the car\")\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "car=Car(4,5,\"diesel\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The Person drives the car\n"
     ]
    }
   ],
   "source": [
    "car.drive()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "class audi(Car):\n",
    "    def __init__(self,windows,doors,enginetype,enableai):\n",
    "        super().__init__(windows,doors,enginetype)\n",
    "        self.enableai=enableai\n",
    "    def selfdriving(self):\n",
    "        print(\"Audi supports Self driving\")\n",
    "        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "audiQ7=audi(5,5,\"diesel\",True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Audi supports Self driving\n"
     ]
    }
   ],
   "source": [
    "audiQ7.selfdriving()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
